package com.yunmaozj.tools.lock.web.annotations;

import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;

/**
 * @author zhongminghong
 * @email zhongmh@yunmaozj.com
 * @create 2020-09-08 9:22
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RequestValve {


    int interval();

    /**
     * 请求头参数
     *
     * @return
     */
    String[] headers() default {};

    /**
     * 请求参数
     *
     * @return
     */
    String[] parameters() default {};

    String[] path() default {};


    TimeUnit timeUnit() default TimeUnit.SECONDS;

    int limit() default 1;

    String responseMessage() default "你太快了！慢点吧！";

    LimitPolicy policy() default LimitPolicy.REJECT;


    enum LimitPolicy {
        REJECT, WAIT;
    }
}
